//
//  DEFIN.h
//  CityFire
//
//  Created by Liuyz on 2017/7/31.
//  Copyright © 2017年 刘养柱. All rights reserved.
//

#ifndef DEFIN_h
#define DEFIN_h

#import <CocoaLumberjack/CocoaLumberjack.h>

#ifdef DEBUG
static const int ddLogLevel = DDLogLevelVerbose;
#else
static const int ddLogLevel = DDLogLevelError;
#endif

#define kStoryBoard(name)    [UIStoryboard storyboardWithName:name bundle:nil]
#define kVCFromSB(name,VC)        (VC *)[kStoryBoard(name) instantiateViewControllerWithIdentifier:NSStringFromClass([VC class])]
#define kHomeStoryBoard      @"Home"
#define kHistoryStoryBoard   @"QueryHistoryViewController"
#define kMonitorStoryBoard   @"Monitor"
#define kStatisticStoryBoard @"Statistic"
#define kPersonalStoryBoard  @"Personal"
#define kLgoinRegisterStoryBoard  @"LoginRegister"


#define kHOME_TITLE            @"首页"
#define kMonitor_TITLE         @"实时监控"
#define kStatistic_TITLE       @"统计"
#define kPersonal_TITLE        @"个人中心"
#define kSystemManger_TITLE    @"系统管理"
#define kPersonalInfo_TITLE    @"个人欣喜"
#define kFavovite_TITLE        @"偏好设置"
#define kMessageNotify_TITLE   @"消息接收"
#define kChangePsd_TITLE       @"修改密码"
//#define kCustomTel_TITLE       @"客服"
#define kPersonManager_TITLE   @"人员管理"
#define kDeviceManager_TITLE   @"设备管理"

#define kCompanySelect_TITLE   @"选择单位"



#define kWARN_USERNAME_INFO    @"请输入用户名"
#define kWARN_PASSWORD_INFO    @"请输入密码"



#define kNSUSERDEFAULT_KEY_SESSIONID @"kNSUSERDEFAULT_KEY_SESSIONID"
#define kNSUSERDEFAULT_KEY_USERINFO  @"kNSUSERDEFAULT_KEY_USERINFO"
#define kNSUSERDEFAULT_KEY_FAVRITORDAYS  @"kNSUSERDEFAULT_KEY_FAVRITORDAYS" //偏好设置取天数
#define kNSUSERDEFAULT_KEY_ISMINKD  @"kNSUSERDEFAULT_KEY_ISMINKD" //是否提醒
#define kNSUSERDEFAULT_KEY_ISSOUND  @"kNSUSERDEFAULT_KEY_ISSOUND" //是否播放声音
#define kNSUSERDEFAULT_KEY_VIBRATE  @"kNSUSERDEFAULT_KEY_VIBRATE" //是否震动提醒

#define kNOTIFICATION_LOGOUT        @"kNOTIFICATION_LOGOUT"       //退出登录通知
#define kNOTIFICATION_ALERT_PWS       @"kNOTIFICATION_ALERT_PWS"       //alert password

#define kNOTIFICATION_UPDATEUSERCENTER @"kNOTIFICATION_UPDATEUSERCENTER" //更新个人中心列表展示行数
//#define kBASE_URL              @"http://jdykj.net:7073"        //服务地址
#define kBASE_URL  @"http://oldsystem.hejiweishi.com:7073/"
//#define kBASE_URL              @"http://xfjcxt.jdykj.net:7073"        //服务地址

//#define SERVER_CONTEXT_NAME    @"/api-p"
#define kLOGIN_URL             @"/api-p/login"                        //登录
//username=admin&password=202cb962ac59075b964b07152d234b70&os=ios&clientId=123&ip=123.123.123.123
#define kLOGOUT_URL            @"/api-p/logout"                 //退出登录
//sessionid=2b123e84-ed4c-4f14-9baf-0e66fd5bb184&username=admin
#define kSESSION_INFO_URL      @"/api-p/sessioninfo"           //通过sessionid和username获取用户信息
//sessionid=2b123e84-ed4c-4f14-9baf-0e66fd5bb184&username=admin&ip=10.10.10.10
#define kDEVICES_URL           @"/api-d/device/queryPersonDevices" //获取用户所有设备
//userName=admin&pageNo=1&pageSize=10&sessionid=x
#define kQueryPersonOrgs_URL   @"/api-d/device/queryPersonOrgs" //查询用户的单位列表

#define kQueryPersonOrgDevices_URL   @"/api-d/device/queryPersonOrgDevices"
//userName=admin&orgname=&pageNo=1&pageSize=10&sessionid=x

#define kQUERY_REAL_WARNING_URL  @"/api-w/warning/queryRealTimeWarning"          //获取实时消息接口
//username=admin&x_day=7&pageNo=1&pageSize=5
//table_name=device_record20170705,device_record20170705&num=1,2&record_usr_log=测试&misinformation=1

#define kQUERY_REAL_WARNINGCOUNT_URL @"/api-w/warning/queryRealTimeWarningCount" //获取实时接口个数
//username=admin&x_day=30&sessionid=1
//#define kQUERY_HistoryTypeWarning_URL @"/api-w/warning/queryHistoryTypeWarning"                 //历史记录接口
#define kWARNING_DEAL_URL       @"/api-w/warning/deal" //提交告警处理请求
//tablename=device_record20170705, device_record20170705&num=1,2&record_usr_log=测试&misinformation=1
#define kWARNING_Statistic_URL       @"/api-w/warning/statistic"
//username=admin&daytype=1&start_time=20170705&end_time=20170805
//#define kqueryRealTimeWarningCount_URL       @"/api-w/warning/queryRealTimeWarningCount"  //实时消息数量接口
//?username=admin&x_day=30&sessionid=1
#define kWARNING_QueryHistoryWarning_URL       @"/api-w/warning/queryHistoryTypeWarning" //历史记录接口
//username=admin&x_day=7&type=报警&pageNo=1&pageSize=5&sessionid=1&start_date=20170725&end_date=20170731
//备注：x_day与start_date，end_date都有值时，采用start_date,end_date的值。
//Type: 报警，故障，异常，离线


#define kPersonGetDeviceInfo_DEAL_URL  @"/api-d/device/getDeviceInfo"
//?username=admin&sessionid=1

#define kChangePasswd_URL  @"/api-p/person/changepasswd"
//?username=admin&oldpwd=aaaaa&newpasswd=bbbbbbbb&sessionid=1
#define kSetRemind_URL       @"/api-p/person/setRemind"  //消息提醒
//?username=admin&remind=1&sound=1&vibrate=1
#define kSetXDay_URL       @"/api-p/person/setX_day"
//?username =admin&sessionid=xxx&x_day=7
#define kDeviceUpdate_URL       @"/api-d/device/edit"//设备更新
#define kQueryAdmins_URL   @"/api-p/person/queryAdmins" //获取个人信息
//?status=&pageNo=1&pageSize=10&sessionid=1

#pragma mark - UICOLOR
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define RGB(r,g,b) RGBA(r,g,b,1.0)

#pragma mark - NSSTRING
#define NSSTRING(a,b) [NSString stringWithFormat:@"%@：%@", a,b]
#define NSSTRING_LONG(a,b) [NSString stringWithFormat:@"%@：%ld", a,b]
#endif /* DEFIN_h */

